home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6087 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  783 b 

  1. Path: kuhub.cc.ukans.edu!moxu
  2. From: moxu@kuhub.cc.ukans.edu
  3. Newsgroups: comp.lang.c++
  4. Subject: Scan a file. Urgent!!!!!!
  5. Message-ID: <1996Feb11.120142.113766@kuhub.cc.ukans.edu>
  6. Date: 11 Feb 96 12:01:42 CST
  7. Organization: University of Kansas Academic Computing Services
  8.  
  9.     A data file has integers, a few characters. I want to read the content
  10. out and assign integer values in the file into an array. I use "fscanf". The
  11. things is when I use "fscanf(datafile,"%d",&digit)", the execution halted when
  12. a character was encounted, probably because this sentence returns "NULL". So, I
  13. can't read through the file and assign all the data into the array.
  14.     Urgent! The project is due Wednesday and now I haven't even set up the array
  15. yet!
  16.     Any hint will be highly appreciated!
  17.     Thanks a lot!
  18.